FX = class('FX')

function FX:initialize(name)

	self.name = name

	if not fex then fex = {} end	

	fex[name] = self

end

function FX:draw()


end

function FX:update()

end

function FX:update_all(dt)
	if fex then
		for i = 1, #fex do
			if fex[i] then
				fex[i]:update(dt)
				
			end
		end
	end
end

function FX:draw_all()
	if fex then
		for i = 1, #fex do
			if fex[i] then
				
				fex[i]:draw()
				
			end
		end
	end
end

FX_FADE = class('FX_FADE', FX)

function FX_FADE:initialize(fade_time)

	local name = "fx_fade"
	self.fade = false
	self.fade_time = fade_time or 3
	self.fade_amt = 255
	FX.initialize(self, name)

end

function FX_FADE:update(dt)

	--self.dt = dt

	if self.fade then
		local r, g, b, a = fadeColor(
			dt,
			2,
			2,
			2,
			5,
			1,
			255, 255, 255,
			0, 0, 0
			)

		if not r then
			self.fade = false
		end


		love.graphics.setColor(r, g, b, a )
		love.graphics.rectangle('fill', 0, 0, 
			love.graphics.getWidth(), love.graphics.getHeight())
	end

end

function FX_FADE:draw()

	
end